package com.yonyou.pmclouds.picture.rmiitf;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.picture.entity.PictureParamVO;
import com.yonyou.pmclouds.picture.entity.PictureToNCCVO;
import com.yonyou.pmclouds.picture.entity.PictureVO;

import java.util.List;
import java.util.Map;

public interface PictureRemoteService {

    PictureVO[] insertPictures(PictureVO[] pictureVOs) throws BusinessException;

    /**
     * 根据单据主键查询单据上的图片
     *
     * @param pk_entity
     * @return
     */
    String[] queryPicNamesByPkEntity(String pk_entity);

    /**
     * 方法功能描述：根据实体主键查询图片信息。
     * <p>
     * <b>参数说明</b>
     *
     * @param pk_entitys
     * @return
     * @throws BusinessException
     * @author zhangwce
     * @time 2017年11月27日 下午6:16:27
     * 图片主键为key 图片名称(地址)为value
     */
    Map<String, List<String>> queryPicsByPkEntitys(String[] pk_entitys) throws BusinessException;

    Map<String, List<PictureVO>> queryByLargePkEntities(String[] pk_entitys) throws BusinessException;

    /**
     * 方法功能描述：对外提供的图片保存接口
     * <p>
     * <b>参数说明</b>
     *
     * @param busiVO
     * @param paramVO
     * @return
     * @author zhangwce
     * @time 2017年11月27日 上午10:53:10
     */
    PictureVO[] insertPictureForPub(SuperVO busiVO, PictureParamVO paramVO) throws BusinessException;

    /**
     * 批量保存表头图片接口
     * 业务单据的类型应保证为一致，
     * 这样对于这一类业务VO只需要一个paramVO即可
     *
     * @param busiVOs
     * @param paramVO
     * @return
     * @throws BusinessException
     * @author zhangwce
     */
    PictureVO[] insertPicturesForPub(SuperVO[] busiVOs, PictureParamVO paramVO) throws BusinessException;

    /**
     * 方法功能描述：对外提供的图片保存接口。
     * <p>
     * <b>参数说明</b>
     *
     * @param bodyVOs
     * @param paramVO
     * @return
     * @throws BusinessException
     * @author zhangwce
     * @time 2017年11月27日 下午1:02:33
     */
    PictureVO[] insertBodyPictureForPub(SuperVO[] bodyVOs, PictureParamVO paramVO) throws BusinessException;

    /**
     * 根据单据主键、图片名称删除图片
     *
     * @param pk_entity
     * @param picNames
     * @return
     * @throws BusinessException
     */
    PictureVO[] deletePictures(String pk_entity, String[] picNames) throws BusinessException;

    /**
     * 更新单据图片
     *
     * @param busiVO  单据实体VO
     * @param paramVO 图片参数实体，用于指明图片中存储的业务信息
     * @return
     * @throws BusinessException
     */
    PictureVO[] updateBillPicture(SuperVO busiVO, PictureParamVO paramVO) throws BusinessException;

    void updatePicBillStatusByBill(String pkBill, byte status);

    /**
     * 通过单据主键获取图片信息
     *
     * @param pkBills
     * @return java.util.Map<java.lang.String       ,       java.util.List       <       com.yonyou.pmclouds.picture.entity.PictureVO>>
     * @author yzx
     * @date 2018/6/4 15:01
     */
    Map<String, List<PictureVO>> getPicsByPkBill(String[] pkBills) throws BusinessException;

    /**
     * 更新示例照片
     *
     * @param pictureVOS
     * @param pkBill
     * @return
     * @throws BusinessException
     */
    PictureVO[] updateExamplePics(PictureVO[] pictureVOS, String pkBill) throws BusinessException;

    /**
     * 查询示例照片
     *
     * @param pkEntity
     * @return
     * @throws BusinessException
     */
    PictureVO[] queryExamplePicsByEntity(String pkEntity) throws BusinessException;

    /**
     * 删除单据下的所有示例照片
     *
     * @param pkBill
     * @return
     * @throws BusinessException
     */
    PictureVO[] deleteExamplePicsOfBill(String pkBill) throws BusinessException;

    /**
     * 删除实体下的所有示例照片
     *
     * @param pkEntity
     * @return
     * @throws BusinessException
     */
    PictureVO[] deleteExamplePicsOfEntity(String pkEntity) throws BusinessException;

    List<PictureToNCCVO> queryByPksTONCC(Map<String, String[]> typePksMap) throws BusinessException;

}
